#!usr/bin/python
# -*= coding: UTF-8 -*-

import itchat
import urllib.request
import urllib.parse
@itchat.msg_register(itchat.content.TEXT)
def print_content(msg):
    text = msg['Text']
    url = 'http://www.niurenqushi.com/api/simsimi/'
    data = {}
    data['txt'] = text
    data = urllib.parse.urlencode(data).encode('utf-8')
    responce = urllib.request.urlopen(url,data)
    html = responce.read().decode('utf-8')
    html = html[22:]
    html = html.rstrip('}')
    html = html.strip('"')
    return html
itchat.auto_login()
itchat.run()




